home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / FTP2UK23.ZIP / hhg10 < prev    next >
Text File  |  1991-10-10  |  2KB  |  77 lines

  1. #!/bin/sh
  2. # hhg - use hhcp to get directory listings and files via FT-RELAY from
  3. #       specific sites (unix and simtel20) offering public access
  4. #
  5. # Version 1.0
  6. #   H.Boothroyd, Warwick Business School, October 1991
  7. #   bsrdp@warwick.ac.uk
  8. # Reworked from FTGET Version 1.0 for FT-RELAY calls to unix sites by
  9. #   Nino Margetic, Dept. of Medical Physisc, UCL
  10. #   nino@mph.sm.ucl.ac.uk
  11. # Tested only under  csh  under  SunOS 4.1.1
  12. #
  13. # Before first use, record some permanent data using the following two
  14. # commands and using your email address in place of mine:
  15. #        hhalias  UK.AC.FT-RELAY  ftb
  16. #        hhstore  ftb
  17. #               transfer authorization: anonymous
  18. #               transfer password: bsrdp@warwick.ac.uk
  19. #               binary word size: 8
  20. #            (press ENTER to skip each other line offered by hhstore)
  21. #
  22. # If an  hhg  request
  23. #    *  works, a suitably named file will arrive,
  24. #    *  fails, you will get an automatic mail report,
  25. #    *  seems to have got lost, you can look for information about it
  26. #       using a command of the form
  27. #               hhq -u bsrdp
  28. #       and you can look for fuller details of attempts using
  29. #               hhlog | less
  30.  
  31. site=$1
  32. case $2 in
  33. "") echo "My use:  hhg site directoryname [-b] filename"
  34.     echo "         hhg site directoryname "
  35.     echo "             |"
  36.     echo "             simtel20  pd1:<msdos.d>f"
  37.     echo "             wuarchive /mirrors/msdos/d/f"
  38.     echo "             garbo     /pc/d/f"
  39.     echo "             garbou    /unix/d/f"
  40.     echo "             nic       /pub/msdos/d/f"
  41.     echo "Example: hhg wuarchive arc-lbr -b fv138.zip"
  42.     echo "Example: hhg wuarchive ."
  43.     exit 1  ;;
  44.  *) shift ;;
  45. esac
  46.  
  47. # unix separators
  48. ds="/" ; dz="" ; df="/" ;
  49. # site details
  50. case $site in
  51. simtel20)  host="wsmr-simtel20.army.mil" ; bdir="pd1:<msdos" ;
  52. # tops20 separators
  53.              ds="." ; dz=">" ; df="" ;;
  54. wuarchive) host="wuarchive.wustl.edu" ; bdir="/mirrors/msdos" ;;
  55. garbo)     host="garbo.uwasa.fi" ; bdir="/pc" ;;
  56. garbou)    host="garbo.uwasa.fi" ; bdir="/unix" ;;
  57. nic)       host="nic.funet.fi" ; bdir="/pub/msdos" ;;
  58. *)         echo "Site $site not included" ; exit 1 ;;
  59. esac
  60.  
  61. case $1 in
  62. .) dir=$bdir$dz      ; locdir=$site     ;;
  63. *) dir=$bdir$ds$1$dz ; locdir=$site.$1  ;;
  64. esac
  65.  
  66. case $2 in
  67.  -b) swch=$2 ; shift ;;
  68.   *) swch=  ;;
  69. esac
  70.  
  71. case $2 in
  72. "") hhcp -L ftb:"$host::(D)$dir"          $locdir.dir ;;
  73.  *) hhcp -L $swch ftb:"$host::$dir$df$2"  $locdir.$2  ;;
  74. esac
  75. exit 0
  76. #end of hhg
  77.